package com.forum.model.pojo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "usermessage")
@SequenceGenerator(name = "sequence", sequenceName = "usermessage_id_seq", allocationSize = 1)
public class UserMessage {
	
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequence")
	@Column(name = "id")
	private Long id;
	
	@Column(name = "messagowner")
	private Long messageOwner;
	
	@Column(name = "messagsender", nullable = false)
	private Long messageSender;
	
	@Column(name = "statusflag", nullable = false)
	private char statusFlag;
	
	@Column(name = "messagtype", nullable = false)
	private char messageType;
	
	@Column(name = "title", nullable = false)
	private String title;
	
	@Column(name = "content", nullable = false)
	private String content;
	
	@Column(name = "createdate", nullable = false)
	private Date createDate;
	
	public UserMessage() {}
	
	public UserMessage(String title, String content, Date createDate, Long messageSender, char statusFlag, char messageType) {
		this.title = title;
		this.content = content;
		this.createDate = createDate;
		this.messageSender = messageSender;
		this.statusFlag = statusFlag;
		this.messageType = messageType;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public char getStatusFlag() {
		return statusFlag;
	}

	public void setStatusFlag(char statusFlag) {
		this.statusFlag = statusFlag;
	}

	public char getMessageType() {
		return messageType;
	}

	public void setMessageType(char messageType) {
		this.messageType = messageType;
	}

	public Long getMessageOwner() {
		return messageOwner;
	}

	public void setMessageOwner(Long messageOwner) {
		this.messageOwner = messageOwner;
	}

	public Long getMessageSender() {
		return messageSender;
	}

	public void setMessageSender(Long messageSender) {
		this.messageSender = messageSender;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	
}
